package cn.wgx.modules.sys.services;

import cn.wgx.modules.base.services.BaseService;
import cn.wgx.modules.sys.entity.SysUserExtend;
import cn.wgx.modules.sys.entity.SysUserExtendExample;
import cn.wgx.modules.sys.entity.mapper.SysUserExtendMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
public class SysUserExtendService extends BaseService<SysUserExtend> {

    @Resource
    SysUserExtendMapper sysUserExtendMapper;

    @Transactional(readOnly = true)
    public List<SysUserExtend> getListByIds(List<Integer> ids) {
        if(ids == null || ids.isEmpty()){
            return emptyList;
        }
        List<Integer> uniList = getUniList(ids);
        if(!uniList.isEmpty()){
            SysUserExtendExample example = new SysUserExtendExample();
            SysUserExtendExample.Criteria criteria = example.createCriteria();
            criteria.andUser_extend_idIn(uniList);
            List<SysUserExtend> eduCourseAssignmentHis = sysUserExtendMapper.selectByExample(example);
            return eduCourseAssignmentHis;
        }
        return null;
    }

}